const observeLCP = new PerformanceObserver((list) => {
    for(const item of list.getEntries()) {
            observeLCP.disconnect()
            const json = item.toJSON()
            const reportData = {
            ...json,
            type: 'performance',
            subType: item.name,
            pageUrl: window.location.href
           }
           console.log(reportData)
    }
})

// buffered 设为true 表示计算所有的fp 与 fcp， 如果不设置，表示调用api之后的fp和fcp
observeLCP.observe({ type: 'largest-contentful-paint' ,buffered: true })
